{% extends "meetup_group_frame.html" %}
{% block title %}
用户资料
{% endblock %}

{% block custom_header%}
<link rel="stylesheet" type="text/css" href="/static/css/font.css"
{% endblock %}

{% block content %}
<div id="C_page">
	<div id="C_pageDividerBlock"></div>
  <div id="C_pageBody">
    <div id="C_context">
    	<div id="C_document" class="" style="margin:0 0 0 0;">
        <div class="D_docsection divby7">
					<!-- first column -->
					<DIV class="D_col D_docCol spans4 first">
						
						<!-- first column body -->
						<DIV class=D_colbody>
					
							<!-- start of D_box -->
							<DIV class=D_box> 
        	
        	
        	
			          <div class="D_boxbody">
			            {% if isself %}
			            <form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
			              {% endif %}
			              
							    <div class="D_boxhead">
						        {%if isself %}
						        <h1>基本设置</h1>
						        {%else%}
						        <h1>用户信息</h1>
						        {%endif%}
						      </div>
								<!-- end of D-boxhead-->
								
								<!-- start -->
								
									<div class="D_boxsection">
										<p><img src="{{user.profile.photo.url}}"/></p>
										<p>姓名：{{user.profile.name}}</p>
                    <p>邮箱：{{user.email}} </p>
                    {% if isself %}
                    <p>密码: (隐藏)   <a href="/accounts/changepassword/">修改</a></p>
                    {% endif %}
									</div>
									<div class="D_boxsection">性别：
						        {%if isself %}
										<label>
											<input type="radio" name="sex" value="男" />
										</label>
										男 
										<label>
											<input type="radio" name="sex" value="女" />
						          女</label>
										<span class="error">{% if form.sex.errors%}&nbsp;*{{form.sex.errors.0}}{% endif %}	</span>
						        {% else %}
						        {{user.profile.sex}}
						        {%endif%}
                    <p>
                    所在公司/学校：
						        {%if isself %}
						        <input type="text" name="profession" value="{{user.profile.profession}}"/>
										<span class="error">{% if form.profession.errors%}&nbsp;*{{form.profession.errors.0}}{% endif %}	</span>
						        {%else%}
						        {{user.profile.profession}}
						        {%endif%}
										</p>
										<p>
                    个性签名：
						        {%if isself %}
						        <input type="text" name="signature" value="{{user.profile.signature}}"/>
										<span class="error">{% if form.signature.errors%}&nbsp;*{{form.signature.errors.0}}{% endif %}	</span>
						        {%else%}
						        {{user.profile.signature}}
						        {%endif%}
										</p>
										<p>
						        联系电话：
						        {%if isself %}
						        <input type="text" name="phone" value="{{user.profile.phone}}"/>
						        {%else%}
						        {{user.profile.phone}}
						        {%endif%}
										</p>
									</div>
	
									{% if first and isself%}
									<div class="D_boxsection">
										<p>您为什么加入相聚网？</p>
										<p>
										<label>
											<textarea name="reason" cols="50" rows="5"></textarea>
										</label>
										</p>
									</div>
									{% endif %}

							    {%if isself %}
									<div class="D_boxsection">
										<p>上传照片</p>
										<p>
										<label>
											<input type="file" name="photo" />
										</label>
										<label></label>
										</p>
									</div>
									<p><label>
										<input name="Submit" type="submit" class="D_submit" value="提交" />
									</label></p>
							        <br/>
							    {% endif%}

							    {%if isself%}
							  </form>
							  {%endif%}

								{%if isself%}
								<script type="text/javascript">
									for (var i = 0; i < document.forms[0].sex.length; i++)
								{
									if (document.forms[0].sex[i].value == "{{user.profile.sex}}")
									{
										document.forms[0].sex[i].checked = true;
									}
								}
								for (var i = 0; i < document.forms[0].profession.length; i++)
								{
									if (document.forms[0].profession[i].value == "{{user.profile.profession}}")
									{
										document.forms[0].profession[i].checked = true;
									}
								}
								</script>
								{%endif%}
							</div>
							<!--end of d_box_body-->
						</div>
						<!--end of d_box-->
					</div>
					<!--end of d_colbody-->
				</div>
				<!-- end of first column-->
				
				<!-- start the second column-->
				<div class="D_col D_docCol last spans3 IE_lastCol">
					
					
					<div class="D_box calltoaction">
						<div class="D_boxbody">
							<div class="D_boxhead" style="text-aligh:left">
								<h2>碰头组 </h2>
							</div> 
							
							<div class="D_boxsection">
								<h3>{%if isself%}我{%else%}TA{%endif%}创建的碰头组
								({{ own_groups|length }})  · · · · · ·  </h3>
								<!-- Column 1 -->
								<DIV class="D_boxcols divby3" style="text-align:center">
									<!-- found place --> 
									    {% for group in own_groups %}
									<DIV class="D_col"> 
										<DIV class=D_colbody> 
											<dl>
											<dt>
                        <a href="/group/{{group.id}}"> 
                        	{% if group.picture %}
                        	<img src="{{group.picture.url}}" width="80" height="80">
                        	{% else %}
                        	<img src="/static/photos/group_pic/default.JPG" width="80" height="80">
                        	{% endif %}
                        </a>
											</dt>
											<dd>
											<a href="/group/{{group.id}}">{{group.name}}</a>
											<span>({{group.users.all|length}})</span>
											</dd>
											</dl>
										</DIV>
									</DIV> 
                      {% endfor %}	
									
									
								</DIV>
							</div>


					
							<div class="D_boxsection">
								<h3>{%if isself%}我{%else%}TA{%endif%}加入的碰头组
								({{ join_groups|length }})  · · · · · ·  </h3>
								<!-- Column 1 -->

								<DIV class="D_boxcols divby4" style="text-align:center">
									<!-- found place --> 
									    {% for group in join_groups %}
									<DIV class="D_col"> 
										<DIV class=D_colbody> 
											<dl>
											<dt>
                        <a href="/group/{{group.id}}"> 
                        	{% if group.picture %}
                        	<img src="{{group.picture.url}}" width="60" height="60">
                        	{% else %}
                        	<img src="/static/photos/group_pic/default.JPG" width="60" height="60">
                        	{% endif %}
                        </a>
											</dt>
											<dd>
											<a href="/group/{{group.id}}">{{group.name}}</a>
											<span>({{group.users.all|length}})</span>
											</dd>
											</dl>
										</DIV>
									</DIV> 
                      {% endfor %}																		
								</DIV>
							</div>




						</div>
					</div>				
					
				</div>
			</div>
		</div>
	</div>
</div>
</div>
{% endblock %}
